#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

#define no 2
int main()
{
    int score[no][3];

    int mem = 0, sum = 0;
    int i = 0, j = 0;
    for (i = 0; i < no; i++)
    {
        sum = 0;
        for (j = 0; j < 3; j++)
        {
            scanf("%d", &score[i][j]);
            sum += score[i][j];
        }
        if (sum < 180)
            mem++;
    }

    printf("%d", mem);
    
    return 0;
}
